// index.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'

Page({
  data: {
    latitude: 34.739471,
    longitude: 117.158988,
    addressName: '微山湖渔家水街景区咨询处(乘船处)',
    markers: [{
      id: 1,
      latitude: 34.73958,
      longitude: 117.159361,
      title: '渔家水街景区咨询处',
      callout: {
        display: 'ALWAYS',
        anchorX: 1,
        anchorX: 1,
        content: '渔家水街景区咨询处'
      },
    }],
    markers1: [{
      id: 1,
      latitude: 34.73958,
      longitude: 117.159361,
      title: '渔家水街景区咨询处',
      customCallout: {
        display: 'ALWAYS',
        anchorX: 1,
        anchorX: 1
      }
    }]
  },
  onLoad() {
    // this.getLocatioFunc();
  },
  getLocatioFunc() {
    wx.getLocation({
      type: 'gcj02',
      success(res) {
        console.log('获取当前的位置', res)
      }
    })
  },
  clickLineFunc() {
    let _this = this;
    wx.openLocation({
      latitude: _this.data.latitude,
      longitude: _this.data.longitude,
      name: _this.data.addressName
    })
  },
  clickCalloutFunc(e) {
    console.log('点击的气泡',e)
    let _this = this;
    wx.openLocation({
      latitude: _this.data.latitude,
      longitude: _this.data.longitude,
      name: _this.data.addressName
    })
  },
  clickPageFunc() {
    wx.navigateTo({
      url: '/pages/logs/logs',
    })
  }
})
